|
|
|
|
- Asymmetric encryption of an envelope
<Buffer type>.EncryptAsymmetricEnvelopped (Function) In french: <Type Buffer>.CrypteAsymétriqueEnveloppé Performs an asymmetric encryption of an envelope.
bufACrypter est un Buffer = "Message à crypter"
bufMessageCrypté est un Buffer
sFichierCléPublique est une chaîne = fRepExe() + "\ClePublique.pem"
sMotDePasseCléPublique est une chaîne = "xxx"
bufMessageCrypté = bufACrypter.CrypteAsymétriqueEnveloppé(sFichierCléPublique, sMotDePasseCléPublique)
bufMessageCrypté est un Buffer
bufMessageDécrypté est un Buffer
sFichierCléPrivée est une chaîne = fRepExe() + "\ClePrivee.pem"
sMotDePasseCléPrivée est une chaîne = "xxx"
bufMessageDécrypté = bufMessageCrypté.DécrypteAsymétriqueEnveloppé(sFichierCléPrivée, sMotDePasseCléPrivée)
bufToEncrypt is Buffer = "Message to encrypt" bufEncryptedMessage is Buffer bufPublicKey is Buffer bufPrivateKey is Buffer (bufPrivateKey, bufPublicKey) = EncryptGenerateRSAKey(1024) // Encrypting a character string //--------------------------------------- bufEncryptedMessage = bufToEncrypt.EncryptAsymmetricEnveloped(bufPublicKey)  // Decryption  // ------------- bufEncryptedMessage is Buffer bufDecryptedMessage is Buffer  bufDecryptedMessage = bufEncryptedMessage.DecryptAsymmetricEnveloped(bufPrivateKey) Syntax
<Result> = <Content to encrypt>.EncryptAsymmetricEnveloped(<Public key file> [, <Password>])
<Result>: Buffer All the information necessary for decryption (algorithms used, encrypted key, initialization vector and encrypted buffer). <Content to encrypt>: Buffer Buffer to encrypt. <Public key file>: Character string or Buffer - Name and path of the file corresponding to the public key that will be used to encrypt. pem, der and p12 key formats are supported.
- Buffer containing the public key that will be used for the encryption.
<Password>: Optional character string Key file password (if required). Remarks Asymmetric encryption of an envelope <Buffer type>.EncryptAsymmetricEnvelopped generates a random encryption key that will be used to encrypt <Content to encrypt> with a symmetric algorithm. The key is encrypted with the public key of <Public key file>. <Result> contains a buffer that concatenates all the necessary information for the decryption (algorithms used, encrypted key, initialization buffer and encrypted buffer). Remarks: - The private key is encrypted using OAEP padding.
- The message is encrypted using AES 256 in CBC with PKCS padding.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|